package com.example.ss.service;

import com.example.ss.dao.MaterialMapper;
import com.example.ss.dao.UserMapper;
import com.example.ss.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * @Author: xwg
 * @CreateDate: 2023/8/25
 */

@Service
public class UserService implements UserDetailsService {

    @Autowired
    private UserMapper UserMapper;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        User user = UserMapper.selectByUsername(username);
        System.out.println("----"+user);
        return user;
    }
}
